<!DOCTYPE HTML>
<html lang="en" >
    <!-- Start book 我旳电子书 -->
    <head>
        <!-- head:start -->
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>浮动 | 我旳电子书</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.9">
        <meta name="author" content="Melon">
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-image-captions/image-captions.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../md/02css/background.html" />
    
    
    <link rel="prev" href="../../md/02css/01selector.html" />
    

        <!-- head:end -->
    </head>
    <body>
        <!-- body:start -->
        
    <div class="book"
        data-level="2.1"
        data-chapter-title="浮动"
        data-filepath="md/02css/float.md"
        data-basepath="../.."
        data-revision="Tue Jun 09 2020 01:19:02 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="md/01html/HTML.html">
            
                
                    <a href="../../md/01html/HTML.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        HTML
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="md/01html/1lebel.html">
            
                
                    <a href="../../md/01html/1lebel.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        HTML标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="md/01html/01list.html">
            
                
                    <a href="../../md/01html/01list.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        列表标签
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="md/02css/01selector.html">
            
                
                    <a href="../../md/02css/01selector.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        css选择器
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="2.1" data-path="md/02css/float.html">
            
                
                    <a href="../../md/02css/float.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        浮动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="md/02css/background.html">
            
                
                    <a href="../../md/02css/background.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        背景属性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="md/02css/position.html">
            
                
                    <a href="../../md/02css/position.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        position定位
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="md/02css/transfrom.html">
            
                
                    <a href="../../md/02css/transfrom.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        transfrom变形
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="md/02css/transition.html">
            
                
                    <a href="../../md/02css/transition.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        transition过渡
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="md/02css/flex.html">
            
                
                    <a href="../../md/02css/flex.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        flex弹性盒子
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="md/02css/textattr.html">
            
                
                    <a href="../../md/02css/textattr.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        textattr文本属性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="md/02css/git.html">
            
                
                    <a href="../../md/02css/git.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        git四步骤
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >我旳电子书</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x6D6E;&#x52A8;">&#x6D6E;&#x52A8;</h1>
<h2 id="&#x603B;&#x7ED3;&#xFF1A;">&#x603B;&#x7ED3;&#xFF1A;</h2>
<ul>
<li>&#x5E03;&#x5C40;&#x601D;&#x8DEF;&#xFF1A;<ol>
<li>&#x89C4;&#x5212;&#x7ED3;&#x6784;</li>
<li>&#x7F16;&#x5199;&#x4E2D;&#x6587;&#x5927;&#x7EB2;</li>
</ol>
</li>
<li><p>&#x5916;&#x90E8;&#x5BB9;&#x5668;</p>
<ol>
<li>&#x5DE6;&#x8FB9;&#x5185;&#x5BB9;</li>
<li>&#x53F3;&#x8FB9;&#x5185;&#x5BB9;</li>
<li>&#x4F7F;&#x7528;&#x6807;&#x7B7E;&#x548C;&#x8272;&#x5757;&#x53BB;&#x5E03;&#x5C40;</li>
<li>&#x5411;&#x91CC;&#x9762;&#x586B;&#x5145;&#x5185;&#x5BB9;</li>
<li>&#x4FEE;&#x6539;&#x6211;&#x4EEC;&#x7684;&#x7EC6;&#x8282;-&gt;&#x9AD8;&#x5EA6;&#x8FD8;&#x539F;&#x8BBE;&#x8BA1;&#x56FE;</li>
</ol>
</li>
<li><p>display&#xFF1A;inline-block&#x7684;&#x5E03;&#x5C40;&#x4F18;&#x7F3A;&#x70B9;</p>
</li>
<li>*&#x4F18;&#x70B9;&#xFF1A;<ol>
<li>&#x89E3;&#x51B3;&#x4E86;&#x5143;&#x7D20;&#x5171;&#x884C;&#x7684;&#x95EE;&#x9898;</li>
<li>&#x52A8;&#x6001;&#x53BB;&#x8BBE;&#x7F6E;&#x5143;&#x7D20;&#x7684;&#x5BBD;&#x9AD8;</li>
</ol>
</li>
<li>&#x7F3A;&#x70B9;&#xFF1A;<ol>
<li>&#x5BB9;&#x5668;&#x5BBD;&#x5EA6;&#xFF0C;&#x5BB9;&#x6613;&#x53D7;&#x5230;&#x7A7A;&#x767D;&#x8282;&#x70B9;&#x5F71;&#x54CD;</li>
<li>&#x663E;&#x793A;&#x6587;&#x5B57;&#x7684;&#x5BB9;&#x5668;&#x4E2D;&#x590D;&#x5199;font-size&#x5C5E;&#x6027;</li>
<li>&#x8BBE;&#x7F6E;vertical-align:top&#xFF0C;&#x9632;&#x6B62;&#x5143;&#x7D20;&#x5782;&#x76F4;&#x65B9;&#x5411;&#x5BF9;&#x9F50;</li>
<li>&#xFF0C;&#x8BBE;&#x7F6E;&#x5176;&#x4E2D;&#x4E00;&#x7AEF;&#x7684;&#x5BBD;&#x5EA6;&#x6216;&#x8005;&#x7528;&#x5916;&#x8FB9;&#x8DDD;&#x9876;&#x8FC7;&#x53BB;&#xFF0C;&#x5BFC;&#x81F4;&#x65E0;&#x6CD5;&#x7075;&#x6D3B;&#x7684;&#x5B9E;&#x73B0;&#x4E24;&#x7AEF;&#x5BF9;&#x9F50;</li>
</ol>
</li>
</ul>
<h2 id="float&#x6D6E;&#x52A8;">float&#x6D6E;&#x52A8;</h2>
<ul>
<li>vertical-align ,&#x4F5C;&#x7528;&#x8BBE;&#x7F6E;&#x5782;&#x76F4;&#x65B9;&#x5411;&#x5BF9;&#x9F50;&#x65B9;&#x5F0F;</li>
<li><p>&#x4E00;&#x822C;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x642D;&#x914D;&#x884C;&#x5185;&#x5757;&#x53CA;&#x5143;&#x7D20;&#x4F7F;&#x7528;</p>
</li>
<li><p>&#x4F7F;&#x5F97;vertical-align&#x5931;&#x6548;</p>
<ol>
<li>&#x5F53;&#x5143;&#x7D20;&#x4F7F;&#x7528;&#x6D6E;&#x52A8;</li>
<li>&#x8EAB;&#x8FB9;&#x6CA1;&#x6709;&#x5176;&#x4ED6;&#x5143;&#x7D20;</li>
<li>&#x6D4F;&#x89C8;&#x5668;&#x4E0D;&#x517C;&#x5BB9;display&#xFF1A;inline-block;</li>
</ol>
</li>
</ul>
<ul>
<li>&#x6269;&#x5C55;&#x5B66;&#x4E60;&#x4E00;&#x4E2A;&#x77E5;&#x8BC6;</li>
<li><p>&#x6E05;&#x9664;&#x6D6E;&#x52A8;</p>
<p>  1  &#x989D;&#x5916;&#x6807;&#x7B7E;&#x6CD5; &#x6DFB;&#x52A0; clear &#x7684;div&#x6807;&#x7B7E;</p>
<ol>
<li>&#x7236;&#x7EA7;&#x5143;&#x7D20;&#x6DFB;&#x52A0;overflow&#xFF1A;hidden&#x5C5E;&#x6027;&#xFF08;&#x4E0D;&#x63A8;&#x8350;&#xFF09;</li>
</ol>
</li>
<li>&#x89E6;&#x53D1;BFC &#xFF08;&#x5757;&#x7EA7;&#x683C;&#x5F0F;&#x5316;&#x4E0A;&#x4E0B;&#x6587;&#xFF09;</li>
<li><p>display&#xFF1A;flow-root</p>
<ol>
<li><p>&#x4F7F;&#x7528;after&#x4F2A;&#x7C7B;&#x5143;&#x7D20;&#xFF08;&#x63A8;&#x8350;&#x4F7F;&#x7528;&#xFF09;</p>
<pre><code> ```
 .clearfix:after{
     content:&quot;&quot;;
     display:block;
     height:0;
     clear:both;
     visibility:hidden;
 }
 ```
</code></pre></li>
</ol>
</li>
</ul>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../md/02css/01selector.html" class="navigation navigation-prev " aria-label="Previous page: css选择器"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../md/02css/background.html" class="navigation navigation-next " aria-label="Next page: 背景属性"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"image-captions":{"attributes":{"style":"left: 50%;position: relative;transform: translateX(-50%);"},"caption":"图 _PAGE_LEVEL_._PAGE_IMAGE_NUMBER_ - _CAPTION_","align":"center","variable_name":"_pictures"},"fontsettings":{"theme":"night","family":"sans","size":2},"toggle-chapters":{},"highlight":{}};
    gitbook.start(config);
});
</script>

        <!-- body:end -->
    </body>
    <!-- End of book 我旳电子书 -->
</html>
